﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dry.Generators;

namespace Dry.Templates
{
    public class BaseIP : GeneratorBase
    {
        public static string GetBaseDAL()
        {
            return GetFileHeader(Dry.ProjectName, "", "", "", "", "") + @"
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using ¤ProjectName¤.DAL;

namespace ¤ProjectName¤.IP
{
    [Serializable]
    public class BaseIP
    {
        public bool HasValue() {

            PropertyInfo[] propertyInfos = this.GetType().GetProperties();

            foreach (PropertyInfo propertyInfo in propertyInfos) {

                if (propertyInfo.GetValue(this, null) != null && propertyInfo.Name.ToLower() != ""deleted"") {

                    return true;
                }
            }

            return false;
        }
    }
}
";
        }
    }
}
